<%@page import="cn.sendto.model.CourseEntity"%>
<%@page import="java.util.List"%>
<%@page import="cn.sendto.mapper.CourseMapper"%>
<%@page import="cn.sendto.mapper.IRowMapper"%>
<%@page import="cn.sendto.dbhelper.DBHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
   if(request.getSession().getAttribute("user")==null){
	   request.getRequestDispatcher("login.jsp").forward(request, response);
   }

%>
    <% 
     request.setCharacterEncoding("utf-8");
     String id=request.getParameter("id");
     DBHelper helper=new DBHelper();
     IRowMapper mapper=new CourseMapper();
     final String QUERY="select * from courseinfo where courseid=?";
     List<CourseEntity> list=helper.executeQuery(QUERY, mapper, id);
     helper.close();
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="css/main.css" />
</head>
<body>
<div class="add_div">
		<form action="update_course.jsp" method="post">
			<div class="add_item">
				<span>科目：<input type="text" name="coursename" value="<%=list.get(0).getCourseName()%>"/>
				</span>
			</div>
			<input type="hidden" value="<%=list.get(0).getCourseId()%>" name="courseid"/>
			<div class="btn">
				<input type="submit" value="提交" />
			</div>
		</form>
	</div>
</body>
</html>